[Top] [Prev] [Next] [Bottom] [Contents]

SaSetSessData

Sets the data for the session identifier.

Synopsis

#include "SaRnHtml.h"
void* SaSetSessData SUTPROTO((pSaSess sess, void* data));

Arguments

sess
A pointer to a session identifier.
data
Data to associate with the current session.

Return Values

Pointer to the old data associated with the input session identifier.

Description

Sets the data for the session identifier. Returns a pointer to the old session data associated with the input session identifier. Returns NULL if the session identifier is invalid or expired. Returns NULL if no data was associated with the session identifier. Note that the old data may need to cleaned up as the session data cleanup functions do not track it.

Example

pSaSess ctx;
void* data;
int num;

ctx = SaGetCtx();
/***now manipulate the current session data ***/
data = SaGetSessData(ctx);
if(data == NULL)
{
	num = 0;
}
else
{
	num = (int)data;
}
/*** keeping track of how many times this user has been here 
***/
num++;
SetSessData((void*) num);
Note: Do not store any data obtained with SaMalloc or stored using SaAddToFree in session data.

See Also



[Top] [Prev] [Next] [Bottom] [Contents]

info@bluestone.com
Copyright © 1997, Bluestone. All rights reserved.